package com.zx.fm.service.impl;

import com.zx.fm.domain.Receipt;
import com.zx.fm.domain.ReceiptVO;
import com.zx.fm.mapper.ReceiptMapper;
import com.zx.fm.service.IReceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * -- 高贵的马儿驱逐体内的一切外力 --
 *
 * @author kaajee
 * @date 2025/9/5
 * @desc
 */
@Service
public class ReceiptServiceImpl implements IReceiptService {
    @Autowired
    private ReceiptMapper ReceiptMapper;

    @Override
    public List<ReceiptVO> selectReceiptList(ReceiptVO receipt) {
        return ReceiptMapper.selectAll(receipt);
    }

    @Override
    public int insertReceipt(Receipt receipt) {
        return ReceiptMapper.insertReceipt(receipt);
    }

    @Override
    public int deleteReceipt(Long id) {
        return ReceiptMapper.deleteReceipt(id);
    }

    @Override
    public Receipt getReceipt(Long id) {
        return ReceiptMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateReceipt(Receipt receipt) {
        return ReceiptMapper.updateByPrimaryKeySelective(receipt);
    }
}
